import PopupContainer from "@/components/app/PopupContainer";
import ByCell from "@/components/ui/ByCell";
import ByCol from "@/components/ui/ByCol";
import ByRow from "@/components/ui/ByRow";
import { View } from "@tarojs/components";

const renderList = [
  { text: "区域", key: "area" },
  { text: "名称", key: "sourceName" },
  { text: "规格", key: "sourceSpec" },
  { text: "单位", key: "sourceUnit" },
  { text: "预算单价", key: "" },
  { text: "结算单价", key: "" },
  { text: "预算数量", key: "ysBudNum" },
  { text: "结算数量", key: "jsBudNum" },
  { text: "预算标配量", key: "standardNum" },
  { text: "结算标配量", key: "jsStandardNum" },
  { text: "预算金额", key: "ysCompreMoney" },
  { text: "结算金额", key: "jsCompreMoney" },
];

export default ({ source, onCancel }) => {
  return (
    <PopupContainer title="预算详情" onCancel={onCancel}>
      <View className="p-3">
        <ByRow wrap>
          {renderList.map((item) => (
            <ByCol span={6}>
              <ByCell vertical label={item.text}>
                {source[item.key]}
              </ByCell>
            </ByCol>
          ))}
        </ByRow>
      </View>
    </PopupContainer>
  );
};
